home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 103
/
XENIATGM103.iso
/
Shareware
/
GoLive 5.0
/
MM10.Cab
/
F2669_db_x.js.2221A912_0B60_4050_989B_99AD310F0534
< prev
next >
Wrap
Text File
|
2000-08-17
|
4KB
|
103 lines
var timer;
var timer2;
function PreLocalSearch()
{
timer = setTimeout( "localSearch()", 10 );
}
function localSearch()
{
var index;
var searchTerm;
var matchStr;
var fileIndicesArr;
var dbSliceFile;
var firstLetterIndex;
// Clear the timer
clearTimeout( timer );
// Get the passed-in index (corresponding to which search expression word we are now on)
//index = location.search.substr(1, location.search.length);
index = top.frames["Help_left"].glob_NdxCurrentWord++;
// Get the search word corresponding to this index.
searchTerm = top.frames["Help_left"].allSearchTerms[index];
// Trim it to the maximum length
searchTerm = searchTerm.substring(0,12);
// See if the (current) search term/word is found in this file's "words" array
if( words[searchTerm] ) {
// ^^^^^^^^^^^^^^^^^^^^^^^
// ^^^^^ MATCH FOUND ^^^^^
// ^^^^^^^^^^^^^^^^^^^^^^^
//................................................................
//.....Get the list of file indices associated with this word.....
//................................................................
matchStr = words[searchTerm];
//....................................................
//.....Split this list into separate file indices.....
//....................................................
fileIndicesArr = matchStr.split(",");
//......................................................................
//.....Process each file index, bumping the 'indexHitsArr' as we go.....
//......................................................................
for( var ndx = 1; ndx < fileIndicesArr.length; ndx++ ) {
top.frames["Help_left"].indexHitsArr[fileIndicesArr[ndx]]++;
}
//.....................................................................
//.....See if we are done processing all of the search words/terms.....
//.....................................................................
if( top.frames["Help_left"].glob_NdxCurrentWord >= top.frames["Help_left"].allSearchTerms.length ) {
// We are done.
PreCallShowResults();
return;
}
//........................................................................
//.....Prepare for and execute the processing of the next search word.....
//........................................................................
firstLetterIndex = top.frames["Help_left"].allSearchTerms[top.frames["Help_left"].glob_NdxCurrentWord].charCodeAt(0);
dbSliceFile = top.dbFilesArr[firstLetterIndex];
if( dbSliceFile.length > 0 ) {
// Our NEXT entered word starts with a letter that
// has a corresponding search db "slice"
//
// ***********************************
// Handle the next "DAISY CHAIN" step.
// ***********************************
top.frames["search_cache"].location = dbSliceFile;
}
else {
// Our first entered word starts with a letter
// not represented by any search db "slice"
top.frames["Help_left"].searchResults_FAIL();
}
}
else {
// ^^^^^^^^^^^^^^^^^^^^^^^^^^
// ^^^^^ NO MATCH FOUND ^^^^^
// ^^^^^^^^^^^^^^^^^^^^^^^^^^
top.frames["Help_left"].searchResults_FAIL();
}
}
function PreCallShowResults()
{
timer2 = setTimeout( "callShowResults()", 10 );
}
function callShowResults()
{
top.frames["Help_left"].assessFinalSearchResults();
clearTimeout( timer2 );
}